<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 每一个构造函数实例化后构造出的每一个对象的公共祖先
        HandPhone.prototype.phoneCall = function() {
            console.log('打电话')
        }
        // 构造函数
        function HandPhone(color, brand) {
            this.$color = color
            this.brand = brand
            this.system = 'IOS'
        }

        // ES6之前实例对象访问原型的方法： iphone5.__proto__.phoneCall

        // iphone5.__proto__.phoneCall = function() {
        //     console.log('打电话')
        // }
        // console.log( iphone5.__proto__ === HandPhone.prototype );

        var iphone5 = new HandPhone('white', 'iphone5')
        iphone5.phoneCall();
        console.log(iphone5)
    </script>
</body>
</html>